Optimal. Leaf size=47 \[ \frac {(A-i B) x}{2 a}+\frac {i A-B}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {3607, 8}
\begin {gather*} \frac {-B+i A}{2 f (a+i a \tan (e+f x))}+\frac {x (A-i B)}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3607
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{a+i a \tan (e+f x)} \, dx &=\frac {i A-B}{2 f (a+i a \tan (e+f x))}+\frac {(A-i B) \int 1 \, dx}{2 a}\\ &=\frac {(A-i B) x}{2 a}+\frac {i A-B}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(102\) vs. \(2(47)=94\).
time = 0.26, size = 102, normalized size = 2.17 \begin {gather*} \frac {\cos (e+f x) (A+B \tan (e+f x)) (A-2 i A f x+B (i-2 f x)+(B-2 i B f x+A (-i+2 f x)) \tan (e+f x))}{4 a f (A \cos (e+f x)+B \sin (e+f x)) (-i+\tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 68, normalized size = 1.45
method | result | size |
risch | \(-\frac {i x B}{2 a}+\frac {x A}{2 a}-\frac {{\mathrm e}^{-2 i \left (f x +e \right )} B}{4 a f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} A}{4 a f}\) | \(54\) |
derivativedivides | \(\frac {-\frac {-\frac {A}{2}-\frac {i B}{2}}{-i+\tan \left (f x +e \right )}+\left (-\frac {i A}{4}-\frac {B}{4}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )+\frac {i \left (-i B +A \right ) \ln \left (i+\tan \left (f x +e \right )\right )}{4}}{f a}\) | \(68\) |
default | \(\frac {-\frac {-\frac {A}{2}-\frac {i B}{2}}{-i+\tan \left (f x +e \right )}+\left (-\frac {i A}{4}-\frac {B}{4}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )+\frac {i \left (-i B +A \right ) \ln \left (i+\tan \left (f x +e \right )\right )}{4}}{f a}\) | \(68\) |
norman | \(\frac {\frac {\left (-i B +A \right ) x}{2 a}-\frac {-i A +B}{2 a f}+\frac {\left (i B +A \right ) \tan \left (f x +e \right )}{2 a f}+\frac {\left (-i B +A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{2 a}}{1+\tan ^{2}\left (f x +e \right )}\) | \(81\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.52, size = 44, normalized size = 0.94 \begin {gather*} \frac {{\left (2 \, {\left (A - i \, B\right )} f x e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{4 \, a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.12, size = 87, normalized size = 1.85 \begin {gather*} \begin {cases} \frac {\left (i A - B\right ) e^{- 2 i e} e^{- 2 i f x}}{4 a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {A - i B}{2 a} + \frac {\left (A e^{2 i e} + A - i B e^{2 i e} + i B\right ) e^{- 2 i e}}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {x \left (A - i B\right )}{2 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 90 vs. \(2 (36) = 72\).
time = 0.54, size = 90, normalized size = 1.91 \begin {gather*} -\frac {\frac {{\left (i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a} + \frac {{\left (-i \, A - B\right )} \log \left (-i \, \tan \left (f x + e\right ) + 1\right )}{a} + \frac {-i \, A \tan \left (f x + e\right ) - B \tan \left (f x + e\right ) - 3 \, A - i \, B}{a {\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.59, size = 45, normalized size = 0.96 \begin {gather*} -\frac {x\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a}+\frac {-\frac {B}{2\,a}+\frac {A\,1{}\mathrm {i}}{2\,a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________